package com.hr.system.service.impl;

import java.util.List;
import com.hr.common.utils.DateUtils;
import com.hr.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hr.system.mapper.BaseSalaryMapper;
import com.hr.system.domain.BaseSalary;
import com.hr.system.service.IBaseSalaryService;
import com.hr.common.core.text.Convert;

/**
 * 员工基本工资Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-27
 */
@Service
public class BaseSalaryServiceImpl implements IBaseSalaryService 
{
    @Autowired
    private BaseSalaryMapper baseSalaryMapper;

    /**
     * 查询员工基本工资
     * 
     * @param id 员工基本工资ID
     * @return 员工基本工资
     */
    @Override
    public BaseSalary selectBaseSalaryById(Integer id)
    {
        return baseSalaryMapper.selectBaseSalaryById(id);
    }

    /**
     * 查询员工基本工资列表
     * 
     * @param baseSalary 员工基本工资
     * @return 员工基本工资
     */
    @Override
    public List<BaseSalary> selectBaseSalaryList(BaseSalary baseSalary)
    {
        return baseSalaryMapper.selectBaseSalaryList(baseSalary);
    }

    /**
     * 新增员工基本工资
     * 
     * @param baseSalary 员工基本工资
     * @return 结果
     */
    @Override
    public int insertBaseSalary(BaseSalary baseSalary)
    {
        baseSalary.setCreateTime(DateUtils.getNowDate());
        baseSalary.setTenantId(ShiroUtils.getTenantId());
        return baseSalaryMapper.insertBaseSalary(baseSalary);
    }

    /**
     * 修改员工基本工资
     * 
     * @param baseSalary 员工基本工资
     * @return 结果
     */
    @Override
    public int updateBaseSalary(BaseSalary baseSalary)
    {
        baseSalary.setUpdateTime(DateUtils.getNowDate());
        return baseSalaryMapper.updateBaseSalary(baseSalary);
    }

    /**
     * 删除员工基本工资对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBaseSalaryByIds(String ids)
    {
        return baseSalaryMapper.deleteBaseSalaryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工基本工资信息
     * 
     * @param id 员工基本工资ID
     * @return 结果
     */
    @Override
    public int deleteBaseSalaryById(Integer id)
    {
        return baseSalaryMapper.deleteBaseSalaryById(id);
    }
}
